﻿@model Propro.Models.Project

<p>
    @if (User.IsInRole("Project" + Model.ProjectId))
    {
        @Html.ActionLink("Create New", "addDownload", new{ projectId = Model.ProjectId })
    }
</p>


@foreach (var item in Model.Downloads)
{
    <div>
        <div class="display-field">
            @Html.DisplayFor(modelItem => item.Description)
        </div>
        <br />
        <div class="display-field">
            @Html.ActionLink(item.Link, "download", new{ downloadId = item.DowloadID })
            @Html.DisplayFor(modelItem => item.date)
        </div>
        <br />
        @if (User.IsInRole("Project" + Model.ProjectId))
        {
            <span>
                @Html.ActionLink("Edit", "EditDownload", new { id = item.DowloadID }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.DowloadID })
            </span>
        }
        <hr />
    </div>    

}

